home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / wind5x.arc / WNDWREF.DOC < prev    next >
Text File  |  1991-01-09  |  103KB  |  2,116 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                            MULTI-LEVEL VIRTUAL WINDOWS
  21.                                  REFERENCE GUIDE
  22.  
  23.                                    Version 5.X
  24.                                 December 20, 1988
  25.  
  26.  
  27.                   Copyright (C) 1988 Eagle Performance Software
  28.                               All Rights Reserved.
  29.  
  30.  
  31.  
  32.                                _______                     
  33.                           ____|__     |               (tm) 
  34.                        --|       |    |------------------- 
  35.                          |   ____|__  |  Association of    
  36.                          |  |       |_|  Shareware         
  37.                          |__|   o   |    Professionals     
  38.                        -----|   |   |--------------------- 
  39.                             |___|___|    MEMBER            
  40.  
  41.  
  42.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  43.  
  44.  
  45.  
  46.                        T A B L E   O F   C O N T E N T S
  47.  
  48.         1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . 4
  49.              Purpose . . . . . . . . . . . . . . . . . . . . . . . 4
  50.              Common Parameters . . . . . . . . . . . . . . . . . . 4
  51.              Attributes  . . . . . . . . . . . . . . . . . . . . . 5
  52.  
  53.         2. PROCEDURES AND FUNCTIONS  . . . . . . . . . . . . . . . 6
  54.              AccessWindow  . . . . . . . . . . . . . . . . . . . . 6
  55.              ChangeBorder  . . . . . . . . . . . . . . . . . . . . 6
  56.              GetLevelIndex . . . . . . . . . . . . . . . . . . . . 6
  57.              HeapOK  . . . . . . . . . . . . . . . . . . . . . . . 7
  58.              HideWindow  . . . . . . . . . . . . . . . . . . . . . 7
  59.              InitWindow  . . . . . . . . . . . . . . . . . . . . . 7
  60.              LocateCursor  . . . . . . . . . . . . . . . . . . . . 7
  61.              MakeWindow  . . . . . . . . . . . . . . . . . . . . . 8
  62.              MaxI  . . . . . . . . . . . . . . . . . . . . . . . . 8
  63.              MaxL  . . . . . . . . . . . . . . . . . . . . . . . . 8
  64.              MaxW  . . . . . . . . . . . . . . . . . . . . . . . . 8
  65.              MinI  . . . . . . . . . . . . . . . . . . . . . . . . 8
  66.              MinL  . . . . . . . . . . . . . . . . . . . . . . . . 9
  67.              MinW  . . . . . . . . . . . . . . . . . . . . . . . . 9
  68.              Move16  . . . . . . . . . . . . . . . . . . . . . . . 9
  69.              MoveWindow  . . . . . . . . . . . . . . . . . . . . . 9
  70.              MoveWords . . . . . . . . . . . . . . . . . . . . . . 9
  71.              RemoveWindow  . . . . . . . . . . . . . . . . . . . . 10
  72.              RestoreBorder . . . . . . . . . . . . . . . . . . . . 10
  73.              RestoreTurboWindow  . . . . . . . . . . . . . . . . . 10
  74.              SetCursorDefault  . . . . . . . . . . . . . . . . . . 11
  75.              SetVirtualSize  . . . . . . . . . . . . . . . . . . . 11
  76.              SetWindowModes  . . . . . . . . . . . . . . . . . . . 11
  77.              ShowWindow  . . . . . . . . . . . . . . . . . . . . . 12
  78.              TitleWindow . . . . . . . . . . . . . . . . . . . . . 12
  79.              VResizeWindow . . . . . . . . . . . . . . . . . . . . 12
  80.              VScrollView . . . . . . . . . . . . . . . . . . . . . 13
  81.              VUpdateCursor . . . . . . . . . . . . . . . . . . . . 13
  82.              VUpdateRows . . . . . . . . . . . . . . . . . . . . . 13
  83.              VUpdateTitles . . . . . . . . . . . . . . . . . . . . 13
  84.              VUpdateView . . . . . . . . . . . . . . . . . . . . . 14
  85.              VUpdateWindow . . . . . . . . . . . . . . . . . . . . 14
  86.              VViewRC . . . . . . . . . . . . . . . . . . . . . . . 14
  87.              VViewRCrel  . . . . . . . . . . . . . . . . . . . . . 14
  88.              VZoomWindow . . . . . . . . . . . . . . . . . . . . . 15
  89.              WEosC . . . . . . . . . . . . . . . . . . . . . . . . 15
  90.              WEosLn  . . . . . . . . . . . . . . . . . . . . . . . 15
  91.              WEosToRC  . . . . . . . . . . . . . . . . . . . . . . 15
  92.              WEosR . . . . . . . . . . . . . . . . . . . . . . . . 16
  93.              WBrdrH  . . . . . . . . . . . . . . . . . . . . . . . 16
  94.              WBrdrPart . . . . . . . . . . . . . . . . . . . . . . 16
  95.              WBrdrV  . . . . . . . . . . . . . . . . . . . . . . . 16
  96.              WClrEol . . . . . . . . . . . . . . . . . . . . . . . 17
  97.              WClrEos . . . . . . . . . . . . . . . . . . . . . . . 17
  98.              WClrField . . . . . . . . . . . . . . . . . . . . . . 17
  99.              WClrFieldEos  . . . . . . . . . . . . . . . . . . . . 17
  100.  
  101.  
  102.                                        2
  103.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  104.  
  105.  
  106.              WClrLine  . . . . . . . . . . . . . . . . . . . . . . 18
  107.              WClrScr . . . . . . . . . . . . . . . . . . . . . . . 18
  108.              WClrTitle . . . . . . . . . . . . . . . . . . . . . . 18
  109.              WDelLine  . . . . . . . . . . . . . . . . . . . . . . 18
  110.              WGotoEos  . . . . . . . . . . . . . . . . . . . . . . 19
  111.              WGotoRC . . . . . . . . . . . . . . . . . . . . . . . 19
  112.              WInsLine  . . . . . . . . . . . . . . . . . . . . . . 19
  113.              WLineH  . . . . . . . . . . . . . . . . . . . . . . . 19
  114.              WLinePart . . . . . . . . . . . . . . . . . . . . . . 20
  115.              WLineV  . . . . . . . . . . . . . . . . . . . . . . . 20
  116.              WriteAndViewPage  . . . . . . . . . . . . . . . . . . 20
  117.              WriteToCRT  . . . . . . . . . . . . . . . . . . . . . 21
  118.              WriteToHidden . . . . . . . . . . . . . . . . . . . . 21
  119.              WriteToPage . . . . . . . . . . . . . . . . . . . . . 21
  120.              WriteToVirtual  . . . . . . . . . . . . . . . . . . . 21
  121.              WScrollDown . . . . . . . . . . . . . . . . . . . . . 22
  122.              WScrollUp . . . . . . . . . . . . . . . . . . . . . . 22
  123.              WWhereC . . . . . . . . . . . . . . . . . . . . . . . 22
  124.              WWhereR . . . . . . . . . . . . . . . . . . . . . . . 22
  125.              WWrite  . . . . . . . . . . . . . . . . . . . . . . . 23
  126.              WWriteA . . . . . . . . . . . . . . . . . . . . . . . 23
  127.              WWriteC . . . . . . . . . . . . . . . . . . . . . . . 24
  128.  
  129.         3. DATA STRUCTURE  . . . . . . . . . . . . . . . . . . . . 25
  130.              Basic Types . . . . . . . . . . . . . . . . . . . . . 25
  131.              Typed Constants . . . . . . . . . . . . . . . . . . . 27
  132.              Untyped Constants . . . . . . . . . . . . . . . . . . 28
  133.              Global Variables  . . . . . . . . . . . . . . . . . . 29
  134.              Dynamic Variables . . . . . . . . . . . . . . . . . . 31
  135.  
  136.         APPENDIX A:  MEMORY ALLOCATION . . . . . . . . . . . . . . 33
  137.              Global Memory . . . . . . . . . . . . . . . . . . . . 33
  138.              Dynamic Memory  . . . . . . . . . . . . . . . . . . . 33
  139.              Code Size . . . . . . . . . . . . . . . . . . . . . . 34
  140.  
  141.         APPENDIX B:  ERROR MESSAGES  . . . . . . . . . . . . . . . 35
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.                                        3
  164.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  165.  
  166.  
  167.    1.  I N T R O D U C T I O N
  168.  
  169.  
  170.    PURPOSE
  171.  
  172.    This document is a technical reference manual describing each routine and 
  173.    variable in detail in a format similar to the TP manual.  The routines are 
  174.    described in alphabetical order.  Since this manual is on disk, you can 
  175.    find your interest easily with any search utility.
  176.  
  177.    Application - Because WNDW uses QWIK, all routines will perform in the 
  178.    following applications:
  179.  
  180.      . All video text modes - 0, 1, 2, 3 and 7.
  181.      . Any column mode - 40, 80, or variable.
  182.      . For IBM PC, XT, AT, PCjr, PC convertible, all PS/2 models, 3270 PC, and 
  183.        compatibles.
  184.      . With MDA, CGA, EGA, MCGA, VGA, 8214/A, all Hercules video cards.
  185.      . Perform routines in both absolute and window-relative coordinates.
  186.  
  187.  
  188.    COMMON PARAMETERS
  189.  
  190.    Common Parameters - Most procedures use the same parameters.  Rather than 
  191.    repeating them for each routine, detailed descriptions for those parameters 
  192.    are listed below.
  193.  
  194.    Window Coordinates - Unless otherwise stated, all WNDW routines work in 
  195.    window-relative coordinates.  For simplicity, virtual routines check for 
  196.    bounds to keep routines confined to the windows and screen.  However, to be 
  197.    fast, some other routines indicated in this document do not check for 
  198.    bounds in the windows or on the screen, so be sure to stay in range.  The 
  199.    upper left column in a window is row 1, column 1, which is also called a 
  200.    1-based coordinate system.
  201.  
  202.    Row/Col - Row and Col were chosen in lieu of the X/Y scheme used in TP.  
  203.    Since WNDW is for only text modes, the screen is treated like a word 
  204.    processor with rows and columns.  It is more intuitive to use the X/Y 
  205.    scheme in graphics and the Row/Col scheme for text.
  206.  
  207.    Rows/Cols - Using Rows/Cols is much easier than Row2/Col2 to describe the 
  208.    height and width of a block such as:
  209.  
  210.       MakeWindow (Row,Col,Rows,Cols,Wattr,Battr,Border,Name);
  211.  
  212.    Should you decide to move the window, only Row and Col need to be changed, 
  213.    and therefore Rows and Cols don't need to be mentally recalculated and 
  214.    altered.  Please keep Cols limited to one row.
  215.  
  216.    NumOfRows/NumOfCols - These parameters indicate a relative shift from a 
  217.    given point that can be positive or negative.
  218.  
  219.    aStr - The window-relative writing routines WWrite and WWriteC actually use 
  220.    QWIK to write this string.  With an external trick of using a pointer, the 
  221.    string isn't recopied the stack and thereby increasing speed even if hard-
  222.  
  223.  
  224.    Chapter 1, Introduction                                             Page 4
  225.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  226.  
  227.  
  228.    coded strings are passed as a parameter.
  229.  
  230.  
  231.    ATTRIBUTES
  232.  
  233.    *Attr - Use the convenient attribute constants for the foreground and 
  234.    background colors supplied in the QWIK unit rather than having to use TP 
  235.    functions or procedures to get a desired color, for example:
  236.     
  237.      MakeWindow (1,1,8,8,White+BlueBG,Yellow+BlueBG,SingleBrdr,aWindow)
  238.  
  239.    will make a window with a white on blue window and yellow on blue border.  
  240.    All subsequent routines will use these attributes for writing.  TextAttr is 
  241.    also set to the window attribute in case the Turbo write routines are used.  
  242.    The foreground constants in QWIK are duplicates of those in TP4 and are 
  243.    repeated here for convenience:
  244.  
  245.      Black        = $00;       DarkGray     = $08;
  246.      Blue         = $01;       LightBlue    = $09;
  247.      Green        = $02;       LightGreen   = $0A;
  248.      Cyan         = $03;       LightCyan    = $0B;
  249.      Red          = $04;       LightRed     = $0C;
  250.      Magenta      = $05;       LightMagenta = $0D;
  251.      Brown        = $06;       Yellow       = $0E;
  252.      LightGray    = $07;       White        = $0F;
  253.      Blink        = $80;                          
  254.  
  255.    In addition, the QWIK background color constants were included to take 
  256.    advantage of constant folding.
  257.  
  258.      BlackBG      = $00;    
  259.      BlueBG       = $10;    
  260.      GreenBG      = $20;    
  261.      CyanBG       = $30;    
  262.      RedBG        = $40;    
  263.      MagentaBG    = $50;    
  264.      BrownBG      = $60;    
  265.      LightGrayBG  = $70;    
  266.      SameAttr     =  -1;  
  267.  
  268.    SameAttr - A powerful and unique feature of all WNDW routines is the use of 
  269.    the constant SameAttr.  If SameAttr, or a negative value, is used as an 
  270.    attribute, the routine will suppress any changes to the attributes and use 
  271.    what is currently on the screen.
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.    Chapter 1, Introduction                                             Page 5
  286.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  287.  
  288.  
  289.    2.  P R O C E D U R E S   A N D   F U N C T I O N S
  290.  
  291.    In this section, a detailed description is provided for each procedure and 
  292.    function.
  293.  
  294.  
  295.    ---------------------------------------------------------------------------
  296.    AccessWindow procedure                                                 Wndw
  297.    ---------------------------------------------------------------------------
  298.    Function       Randomly accesses a covered window and places it on the top.  
  299.                   If the window is hidden, it uses ShowWindow to put it on 
  300.                   top.
  301.    Declaration    AccessWindow (WindowName: WindowNames)
  302.    Screens        All video pages.
  303.    Remarks        All underlays are properly updated in the heap with a high 
  304.                   speed technique.  If NoAccessMode has been set for this 
  305.                   window or an invalid window name is used, the procedure is 
  306.                   simply ignored.  Virtual windows are updated after being 
  307.                   shown.  Zoom effect is optional.  The WndwStats are shuffled 
  308.                   to match the new levels.
  309.    Restrictions   Shadows are permitted, but exposed corners on lower level 
  310.                   windows with shadows will not be updated until moved.  For 
  311.                   human factors, shadows are only recommended for the top 
  312.                   window anyway.
  313.    EOS            Restored to new window.
  314.    Heap           Temporarily uses (underlay size * 1.5).
  315.    Exit           Forced to write to CRT.
  316.    See also       HideWindow, ShowWindow
  317.  
  318.    ---------------------------------------------------------------------------
  319.    ChangeBorder procedure                                                 Wndw
  320.    ---------------------------------------------------------------------------
  321.    Function       Changes the border to a new border style.
  322.    Declaration    ChangeBorder (NewBrdr: Borders)
  323.    Screens        All video pages.
  324.    Remarks        The original border style is already saved in ViewBrdr.  The 
  325.                   current border is changed by searching for a match of WSbrdr 
  326.                   for each border part with the current attribute.  If a match 
  327.                   is found, it is replaced with NewBrdr.  Tees as well as 
  328.                   virtual borders are also replaced.  The original border can 
  329.                   later be restored with RestoreBorder. 
  330.    EOS            Restored to CRT.
  331.    Exit           Forced to write to CRT.
  332.    Restrictions   NoBrdr is ignored as either the original or new border.
  333.    See also       RestoreBorder
  334.  
  335.    ---------------------------------------------------------------------------
  336.    GetLevelIndex function                                                 Wndw
  337.    ---------------------------------------------------------------------------
  338.    Function       Returns the WndwStat index given the WindowName.
  339.    Declaration    GetLevelIndex (WindowName: WindowNames)
  340.    Result type    word
  341.    Remarks        This routine scans for the first matching WindowName.  It 
  342.                   scans from the top level index (LI) first and then down.  
  343.                   Hidden windows from the hidden level index (HLI) up are 
  344.  
  345.  
  346.    Chapter 2, Procedures and Functions                                 Page 6
  347.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  348.  
  349.  
  350.                   scanned last.  If no match is found, the result is >MaxWndw.
  351.  
  352.    ---------------------------------------------------------------------------
  353.    HeapOK function                                                        Wndw
  354.    ---------------------------------------------------------------------------
  355.    Function       Returns TRUE if enough heap is available from MaxAvail.
  356.    Declaration    HeapOK (NumOfBytes: word)
  357.    Result type    boolean
  358.    Remarks        If there is insufficient heap, the program terminates 
  359.                   through the GOOF unit.  The error window will display 
  360.                   MemAvail and MaxAvail.  All WNDW procedures that use the 
  361.                   heap run this routine.
  362.  
  363.    ---------------------------------------------------------------------------
  364.    HideWindow procedure                                                   Wndw
  365.    ---------------------------------------------------------------------------
  366.    Function       Hides the current top window on the CRT.
  367.    Declaration    HideWindow
  368.    Screens        All video pages.
  369.    Remarks        The window is saved in RAM and the underlay is restored on 
  370.                   the screen showing the new top window.  If NoHideMode has 
  371.                   been set for this window, the procedure is ignored.  The 
  372.                   windows are saved with the border, but without any shadow.
  373.    EOS            Altered to (Wrow,Wcol) before hiding, then restored to the 
  374.                   new top window.  
  375.    Heap           Temporarily uses (underlay size * 1.5).
  376.    Exit           Forced to write to CRT.
  377.    See also       ShowWindow
  378.  
  379.    ---------------------------------------------------------------------------
  380.    InitWindow procedure                                                   Wndw
  381.    ---------------------------------------------------------------------------
  382.    Function       Initializes global data for WNDW routines.  In brief, it 
  383.                   sets the defaults for WndwStat, indexes and margins for each 
  384.                   video page.
  385.    Declaration    InitWindow (Wattr: integer; ClearScr: boolean);
  386.    Remarks        This is the first routine required to executed early in the 
  387.                   main program and only needs to be done once.  Wattr is the 
  388.                   attribute for the full screen (Window0) for all video pages.  
  389.                   If ClearScr is true, then all video pages are cleared with 
  390.                   Wattr.  Over 50 variables are initialized with this 
  391.                   procedure.  See InitWindow source code for details.
  392.    EOS            Set to (1,1).
  393.    Heap           Allocates VirtualStat and PageStat arrays as required.
  394.    See also       SetCursorDefault, WNDW5X.DOC and Data Structure section.
  395.  
  396.    ---------------------------------------------------------------------------
  397.    LocateCursor procedure                                                 Wndw
  398.    ---------------------------------------------------------------------------
  399.    Function       Locates the cursor within the window.
  400.    Declaration    LocateCursor
  401.    Screens        All video pages.
  402.    Remarks        This routine, a subroutine of RestoreTurboWindow, locates 
  403.                   the cursor as set in the WndwStat for fixed or virtual 
  404.                   windows.  It is usually handled automatically, but is 
  405.  
  406.  
  407.    Chapter 2, Procedures and Functions                                 Page 7
  408.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  409.  
  410.  
  411.                   available for handling exceptions.  VUpdateCursor is a 
  412.                   subroutine of LocateCursor.
  413.    See also       RestoreTurboWindow, VUpdateCursor
  414.  
  415.    ---------------------------------------------------------------------------
  416.    MakeWindow procedure                                                   Wndw
  417.    ---------------------------------------------------------------------------
  418.    Function       Makes a window.
  419.    Declaration    MakeWindow (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
  420.                               BrdrSel: Borders; WindowName: WindowNames)
  421.    Screens        All video pages.
  422.    Remarks        This is the main routine to create windows.  Row, Col, Row, 
  423.                   and Rows is the absolute coordinates for the window 
  424.                   inclusive of any border.  For RelMode, (Row,Col) is window 
  425.                   relative.  Wattr and Battr are the window and border 
  426.                   attributes, respectively (SameAttr is permitted).  BrdrSel 
  427.                   is the selection of one of 15 different borders.  WindowName 
  428.                   is a unique window name required for random access. EOS            
  429.                   Set to (1,1).
  430.    Heap           Allocates underlay size until removed.
  431.    Restrictions   Minimum size - (1x1) without borders, (3x3) with borders. 
  432.    See also       SetWindowModes, RemoveWindow
  433.  
  434.    ---------------------------------------------------------------------------
  435.    MaxI function                                                         Wutil
  436.    ---------------------------------------------------------------------------
  437.    Function       Returns the maximum value of two integers.
  438.    Declaration    MaxI (Value1,Value2: integer)
  439.    Result type    integer
  440.    Remarks        High speed evaluation of two integers.
  441.    See also       MaxL, MaxW, MinI, MinL, MinW
  442.   
  443.    ---------------------------------------------------------------------------
  444.    MaxL function                                                         Wutil
  445.    ---------------------------------------------------------------------------
  446.    Function       Returns the maximum value of two long integers.
  447.    Declaration    MaxI (Value1,Value2: longint)
  448.    Result type    longint
  449.    Remarks        High speed evaluation of two long integers.
  450.    See also       MaxI, MaxW, MinI, MinL, MinW
  451.   
  452.    ---------------------------------------------------------------------------
  453.    MaxW function                                                         Wutil
  454.    ---------------------------------------------------------------------------
  455.    Function       Returns the maximum value of two words.
  456.    Declaration    MaxW (Value1,Value2: word)
  457.    Result type    word
  458.    Remarks        High speed evaluation of two words.
  459.    See also       MaxI, MaxL, MinI, MinL, MinW
  460.   
  461.    ---------------------------------------------------------------------------
  462.    MinI function                                                         Wutil
  463.    ---------------------------------------------------------------------------
  464.    Function       Returns the minimum value of two integers.
  465.    Declaration    MinI (Value1,Value2: integer)
  466.  
  467.  
  468.    Chapter 2, Procedures and Functions                                 Page 8
  469.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  470.  
  471.  
  472.    Result type    integer
  473.    Remarks        High speed evaluation of two integers.
  474.    See also       MaxI, MaxL, MaxW, MinL, MinW
  475.   
  476.    ---------------------------------------------------------------------------
  477.    MinL function                                                         Wutil
  478.    ---------------------------------------------------------------------------
  479.    Function       Returns the minimum value of two long integers.
  480.    Declaration    MinI (Value1,Value2: longint)
  481.    Result type    longint
  482.    Remarks        High speed evaluation of two long integers.
  483.    See also       MaxI, MaxL, MaxW, MinI, MinW
  484.   
  485.    ---------------------------------------------------------------------------
  486.    MinW function                                                         Wutil
  487.    ---------------------------------------------------------------------------
  488.    Function       Returns the minimum value of two words.
  489.    Declaration    MinW (Value1,Value2: word)
  490.    Result type    word
  491.    Remarks        High speed evaluation of two words.
  492.    See also       MaxI, MaxL, MaxW, MinI, MinL
  493.   
  494.    ---------------------------------------------------------------------------
  495.    Move16 procedure                                                      Wutil
  496.    ---------------------------------------------------------------------------
  497.    Function       Copies a specified number of contiguous bytes from a source 
  498.                   range to a destination range.
  499.    Declaration    Move16 (VAR Source,Dest; NumOfBytes: word)
  500.    Remarks        Exactly like TP's Move except twice as fast by using 16-bit 
  501.                   transfers.  Use in lieu of Move.
  502.    See also       MoveWords
  503.   
  504.    ---------------------------------------------------------------------------
  505.    MoveWindow procedure                                                   Wndw
  506.    ---------------------------------------------------------------------------
  507.    Function       Moves the current top window on the CRT a relative number of 
  508.                   rows and columns.
  509.    Declaration    MoveWindow (NumOfRows,NumOfCols: integer)
  510.    Screens        All video pages.
  511.    Remarks        If NoMoveMode or PermMode has been set for this window, the 
  512.                   procedure is ignored.  Shadows are fully supported.  Margins 
  513.                   are respected.
  514.    EOS            Moved relatively to the same place.
  515.    Heap           Maximum requirement is full screen size plus the underlay 
  516.                   size.
  517.    Exit           Forced to write to CRT.
  518.    See also       ShowWindow
  519.  
  520.    ---------------------------------------------------------------------------
  521.    MoveWords procedure                                                   Wutil
  522.    ---------------------------------------------------------------------------
  523.    Function       Copies a specified number of contiguous bytes from a source 
  524.                   range to a destination range.
  525.    Declaration    MoveWords (VAR Source,Dest; NumOfWords: word)
  526.    Remarks        Even faster than Move16.
  527.  
  528.  
  529.    Chapter 2, Procedures and Functions                                 Page 9
  530.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  531.  
  532.  
  533.    Restrictions   Source[0] and Dest must not overlap.  
  534.    See also       Move16
  535.   
  536.    ---------------------------------------------------------------------------
  537.    RemoveWindow procedure                                                 Wndw
  538.    ---------------------------------------------------------------------------
  539.    Function       Removes the current top window on the CRT.
  540.    Declaration    RemoveWindow 
  541.    Screens        All video pages.
  542.    Remarks        Basically, the top window is removed restoring the underlay 
  543.                   and then erased from memory.  Depending on the window mode, 
  544.                   RemoveWindow responds differently:
  545.  
  546.                     RelMode     - The window-relative stats are simply 
  547.                                   replaced with the parent window stats.
  548.                     PermMode    - The stats are simply dropped from the stack.
  549.                     VirtualMode - The virtual screen is additionally removed 
  550.                                   from the heap.
  551.  
  552.    EOS            Restored to the new top window.
  553.    Heap           Deallocates the underlay.
  554.    Exit           Forced to write to CRT.
  555.    See also       MakeWindow
  556.  
  557.    ---------------------------------------------------------------------------
  558.    RestoreBorder procedure                                                Wndw
  559.    ---------------------------------------------------------------------------
  560.    Function       Restores the border to the original border style.
  561.    Declaration    RestoreBorder
  562.    Screens        All video pages.
  563.    Remarks        Reverses the effect of ChangeBorder by replacing the current 
  564.                   border style back to the original.
  565.    EOS            Restored to CRT.
  566.    Exit           Forced to write to CRT.
  567.    See also       ChangeBorder
  568.  
  569.    ---------------------------------------------------------------------------
  570.    RestoreTurboWindow procedure                                           Wndw
  571.    ---------------------------------------------------------------------------
  572.    Function       Restores attributes, cursor, and EOS marker for the current 
  573.                   window.
  574.    Declaration    RestoreTurboWindow
  575.    Screens        All video pages.
  576.    Remarks        Usually this procedure is handled automatically.  If there 
  577.                   is some exception in handling, then this procedure can be 
  578.                   used.  It does the following:
  579.  
  580.                     . Resets TextAttr and ScrollAttr to OrigAttr
  581.                     . Restores Turbo window
  582.                     . Reset EOS marker to last saved location
  583.                     . Resets cursor mode 
  584.                     . Locates cursor with LocateCursor
  585.  
  586.    EOS            Restored.
  587.    See also       LocateCursor
  588.  
  589.  
  590.    Chapter 2, Procedures and Functions                                 Page 10
  591.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  592.  
  593.  
  594.  
  595.    ---------------------------------------------------------------------------
  596.    SetCursorDefault procedure                                             Wndw
  597.    ---------------------------------------------------------------------------
  598.    Function       Sets the default cursor mode to be used by MakeWindow.
  599.    Declaration    SetCursorDefault (CursorMode: word)
  600.    Remarks        This routine simply assigns a value to the global variable 
  601.                   CursorDefault.  This value is already assigned by InitWindow 
  602.                   to the current cursor mode.  If a specific cursor mode is 
  603.                   required for the initial window as well, use Qwik.SetCursor 
  604.                   instead before InitWindow.
  605.    See also       InitWindow, MakeWindow
  606.  
  607.    ---------------------------------------------------------------------------
  608.    SetVirtualSize procedure                                               Wndw
  609.    ---------------------------------------------------------------------------
  610.    Function       Sets the dimensions for the virtual screen of virtual 
  611.                   windows.
  612.    Declaration    SetVirtualSize (Rows,Cols: byte)
  613.    Remarks        This optional procedure sets the rows-by-columns dimensions 
  614.                   for a virtual screen.  Keep in mind that two additional rows 
  615.                   will be internally added for titles if borders are used.  
  616.                   The default at startup is the CRT screen size.  
  617.    Restrictions   Maximum buffer size is 64k.
  618.    See also       MakeWindow
  619.    Example        Set the size for a virtual screen with 80 columns and a 
  620.                   maximum number of rows:
  621.  
  622.                     SetVirtualSize (253,80);
  623.  
  624.                   The resulting size would be (253+2)*80*2 = 40,800 bytes 
  625.                   which is under 64k.  Rows 254 and 255 would be reserved for 
  626.                   top and bottom titles on the border.
  627.  
  628.    ---------------------------------------------------------------------------
  629.    SetWindowModes procedure                                               Wndw
  630.    ---------------------------------------------------------------------------
  631.    Function       Sets the window modes to be used by MakeWindow.
  632.    Declaration    SetWindowModes (SumOfAllModes: word)
  633.    Remarks        There are several different modes that can be used:
  634.  
  635.       RelMode       - Window-relative frame of reference, no underlay
  636.       PermMode      - Can't be moved or removed, no underlay
  637.       ShadowLeft    - Shadow on the left side
  638.       ShadowRight   - Shadow on the right side
  639.       ZoomMode      - Zoom effect on Make, Show and AccessWindow
  640.       HiddenMode    - Create window as hidden
  641.       VirtualMode   - Create virtual screen as well
  642.       CursorOffMode - Leaves cursor off for window
  643.       SeeThruMode   - Doesn't clear area inside window
  644.       NoHideMode    - Ignores request to hide window
  645.       NoAccessMode  - Ignores request to access window
  646.       NoMoveMode    - Ignores request to move/resize window
  647.  
  648.                   The startup mode is equivalent to zero while the base window 
  649.  
  650.  
  651.    Chapter 2, Procedures and Functions                                 Page 11
  652.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  653.  
  654.  
  655.                   is PermMode.  The modes should be summed logically, but can 
  656.                   also be done arithmetically with care.  All PermMode windows 
  657.                   must be created first.
  658.    See also       MakeWindow
  659.    Example        Set the modes for the next window to have a right shadow, 
  660.                   zoom effect, cursor off, and a virtual screen:
  661.  
  662.                     SetWindowModes (ShadowRight or ZoomMode or CursorOffMode
  663.                                     or VirtualMode);
  664.  
  665.    Example        Set the modes back to defaults:
  666.  
  667.                     SetWindowModes (0);
  668.  
  669.    ---------------------------------------------------------------------------
  670.    ShowWindow procedure                                                   Wndw
  671.    ---------------------------------------------------------------------------
  672.    Function       Shows a hidden window to become the current top window on 
  673.                   the CRT.
  674.    Declaration    ShowWindow (WindowName: WindowNames)
  675.    Screens        All video pages.
  676.    Remarks        The underlay is saved from the screen and the window is 
  677.                   restored from RAM to become the new top window.  Invalid 
  678.                   window names are simply ignored.  Virtual windows are 
  679.                   updated before being shown.  Zoom effect is optional.
  680.    EOS            Set to (1,1).
  681.    Heap           Temporarily uses (underlay size * 1.5).
  682.    Exit           Forced to write to CRT.
  683.    See also       HideWindow, AccessWindow
  684.  
  685.    ---------------------------------------------------------------------------
  686.    TitleWindow procedure                                                  Wndw
  687.    ---------------------------------------------------------------------------
  688.    Function       Places a title on the current window.
  689.    Declaration    TitleWindow (TopOrBottom,Justify: DirType;
  690.                                TitleAttr: integer; Title: string);
  691.    Screens        All video pages.
  692.    Remarks        There are six positions where the title can be placed in any 
  693.                   combination of Top or Bottom, and Left, Center, or Right.  
  694.                   TitleAttr is the title attribute (SameAttr is permitted).  
  695.                   The titles can be written to hidden windows or virtual 
  696.                   screens as well.  TitleOfs can be adjusted for 
  697.                   justification.
  698.    EOS            Unaltered.
  699.    See also       TitleOfs in Data Structure section.
  700.  
  701.    ---------------------------------------------------------------------------
  702.    VResizeWindow procedure                                                Wndw
  703.    ---------------------------------------------------------------------------
  704.    Function       Resizes the current top virtual window.
  705.    Declaration    VResizeWindow (NumOfRows,NumOfCols: integer)
  706.    Remarks        The top window is resized by moving the right and/or bottom 
  707.                   border.  If NoMoveMode or PermMode has been set for this 
  708.                   window, the procedure is ignored.  Shadows are fully 
  709.                   supported.  Margins are respected.
  710.  
  711.  
  712.    Chapter 2, Procedures and Functions                                 Page 12
  713.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  714.  
  715.  
  716.    Heap           Maximum requirement is full screen size plus the underlay 
  717.                   size.
  718.    Exit           Forced to write to CRT.
  719.    Restrictions   None.
  720.    See also       VZoomWindow
  721.  
  722.    ---------------------------------------------------------------------------
  723.    VScrollView procedure                                                  Wndw
  724.    ---------------------------------------------------------------------------
  725.    Function       Alters the upper left viewing reference point of the current 
  726.                   virtual screen by a relative number of rows and columns.  
  727.                   The view window is also updated no matter where its location 
  728.                   even if hidden or overlapped.
  729.    Declaration    VScrollView (NumOfRows,NumOfCols: integer)
  730.    Remarks        The reference point may be adjusted to keep the viewing 
  731.                   window within the virtual window limits.  Works in any 
  732.                   "WriteTo" mode.
  733.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  734.    Restrictions   None.
  735.    See also       VViewRC, VViewRCrel
  736.  
  737.    ---------------------------------------------------------------------------
  738.    VUpdateCursor procedure                                                Wndw
  739.    ---------------------------------------------------------------------------
  740.    Function       Updates the current virtual window cursor if it is the top 
  741.                   window on the CRT.
  742.    Declaration    VUpdateCursor
  743.    Remarks        When the cursor is moved on the virtual screen, the cursor 
  744.                   may or may not be seen in the view.  This routine updates 
  745.                   the location.  Works in any "WriteTo" mode.
  746.    See also       VUpdateTitles, VUpdateView, VUpdateWindow
  747.  
  748.    ---------------------------------------------------------------------------
  749.    VUpdateRows procedure                                                  Wndw
  750.    ---------------------------------------------------------------------------
  751.    Function       Updates certain rows in the current virtual window view only 
  752.                   on the top window.
  753.    Declaration    VUpdateRows (Row,Rows: byte)
  754.    Remarks        This routine is primarily used for fast response for spot 
  755.                   updates for data entry or the like where the fastest speed 
  756.                   is desirable.  If the window is not the top window, the 
  757.                   entire view is updated.
  758.    See also       VUpdateView, VUpdateWindow
  759.  
  760.    ---------------------------------------------------------------------------
  761.    VUpdateTitles procedure                                                Wndw
  762.    ---------------------------------------------------------------------------
  763.    Function       Updates the current virtual window titles.  It is also 
  764.                   updated no matter where its location even if hidden or 
  765.                   overlapped.
  766.    Declaration    VUpdateTitles
  767.    Remarks        This routine updates the titles to the window and truncates 
  768.                   them to fit in the current view.  Works in any "WriteTo" 
  769.                   mode.
  770.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  771.  
  772.  
  773.    Chapter 2, Procedures and Functions                                 Page 13
  774.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  775.  
  776.  
  777.    See also       VUpdateCursor, VUpdateView, VUpdateWindow
  778.  
  779.    ---------------------------------------------------------------------------
  780.    VUpdateView procedure                                                  Wndw
  781.    ---------------------------------------------------------------------------
  782.    Function       Updates the current virtual window view.  It is also updated 
  783.                   no matter where its location even if hidden or overlapped.
  784.    Declaration    VUpdateView
  785.    Remarks        This routine updates the full view of the window.  Works in 
  786.                   any "WriteTo" mode.
  787.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  788.    See also       VUpdateRows, VUpdateTitles, VUpdateWindow
  789.  
  790.    ---------------------------------------------------------------------------
  791.    VUpdateWindow procedure                                                Wndw
  792.    ---------------------------------------------------------------------------
  793.    Function       Updates the current virtual window including the view, 
  794.                   titles and the cursor.  It is also updated no matter where 
  795.                   its location even if hidden or overlapped.
  796.    Declaration    VUpdateWindow
  797.    Remarks        This is the main routine to update virtual windows.  This 
  798.                   routine simply executes three procedures: VUpdateCursor, 
  799.                   VUpdateView, and VUpdateTitles.  Works in any "WriteTo" 
  800.                   mode.  
  801.    Heap           If covered, WSrows * Wcols * 5 bytes is temporarily used.
  802.    See also       VUpdateCursor, VUpdateRows, VUpdateTitles, VUpdateView
  803.  
  804.    ---------------------------------------------------------------------------
  805.    VViewRC procedure                                                      Wndw
  806.    ---------------------------------------------------------------------------
  807.    Function       Alters the upper left viewing reference point of the current 
  808.                   virtual window.
  809.    Declaration    VViewRC (Row,Col: byte)
  810.    Remarks        The reference point may be adjusted to keep the viewing 
  811.                   window within the virtual window limits.  Works in any 
  812.                   "WriteTo" mode.  It does not update the viewing window.
  813.    Restrictions   None.
  814.    See also       VViewRCrel, VScrollView
  815.  
  816.    ---------------------------------------------------------------------------
  817.    VViewRCrel procedure                                                   Wndw
  818.    ---------------------------------------------------------------------------
  819.    Function       Alters the upper left viewing reference point of the current 
  820.                   virtual window by a relative number of rows and columns.
  821.    Declaration    VViewRCrel (NumOfRows,NumOfCols: integer)
  822.    Remarks        The reference point may be adjusted to keep the viewing 
  823.                   window within the virtual window limits.  Works in any 
  824.                   "WriteTo" mode.  It does not update the viewing window.
  825.    Restrictions   None.
  826.    See also       VViewRC, VScrollView
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.    Chapter 2, Procedures and Functions                                 Page 14
  835.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  836.  
  837.  
  838.    ---------------------------------------------------------------------------
  839.    VZoomWindow procedure                                                  Wndw
  840.    ---------------------------------------------------------------------------
  841.    Function       Toggles top virtual window between full screen size and 
  842.                   original size.
  843.    Declaration    VZoomWindow
  844.    Remarks        If the window is less than full size, the window is zoomed 
  845.                   to full size and centered if necessary.  Executing the 
  846.                   procedure again will restore the size and location of this 
  847.                   window.  If NoMoveMode or PermMode has been set for this 
  848.                   window, the procedure is ignored.  Shadows are fully 
  849.                   supported.  Margins are respected.
  850.    Heap           Maximum requirement is full screen size plus the underlay 
  851.                   size.
  852.    Exit           Forced to write to CRT.
  853.    See also       VResizeWindow
  854.  
  855.    ---------------------------------------------------------------------------
  856.    WEosC function                                                         Wndw
  857.    ---------------------------------------------------------------------------
  858.    Function       Returns the window-relative column of the EOS marker.
  859.    Declaration    WEosC
  860.    Result type    byte
  861.    Screens        All video pages and virtual screens.
  862.    Remarks        Operates on the currently written screen.  The upper left 
  863.                   corner of the window is (1,1). 
  864.    See also       WEosR, WEosToRC, WEosLn, WGotoEos
  865.  
  866.    ---------------------------------------------------------------------------
  867.    WEosLn procedure                                                       Wndw
  868.    ---------------------------------------------------------------------------
  869.    Function       Moves the EOS marker to column 1 of the next window-relative 
  870.                   row with a possible scroll up.
  871.    Declaration    WEosLn
  872.    Screens        All video pages and virtual screens.
  873.    Remarks        Operates on the currently written window.  If WEosR becomes 
  874.                   greater than the number of window rows, then the window will 
  875.                   scroll up.  The new blank row will have the attribute set by 
  876.                   WndwAttr which is the window attribute.
  877.    EOS            Updated to first cleared column of the cleared row.
  878.    See also       WEosR, WEosC, WEosToRC, WGotoEos
  879.  
  880.    ---------------------------------------------------------------------------
  881.    WEosToRC procedure                                                     Wndw
  882.    ---------------------------------------------------------------------------
  883.    Function       Positions the EOS marker relative to the current window.
  884.    Declaration    WEosToRC (Row, Col: byte)
  885.    Screens        All video pages and virtual screens.
  886.    Remarks        Use this procedure to manually locate the EOS marker.  All 
  887.                   EOS procedures will write where this marker is located on 
  888.                   the currently written screen.
  889.    EOS            Updated.
  890.    Restrictions   Stay within the window limits.
  891.    See also       QWIK, WEosR, WEosC, WEosLn, WGotoEos
  892.    
  893.  
  894.  
  895.    Chapter 2, Procedures and Functions                                 Page 15
  896.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  897.  
  898.  
  899.    ---------------------------------------------------------------------------
  900.    WEosR function                                                         Wndw
  901.    ---------------------------------------------------------------------------
  902.    Function       Returns the window-relative row of the EOS marker.
  903.    Declaration    WEosR
  904.    Result type    byte
  905.    Screens        All video pages and virtual screens.
  906.    Remarks        Operates on the currently written screen.  The upper left 
  907.                   corner of the window is (1,1). 
  908.    See also       WEosC, WEosToRC, WEosLn, WGotoEos
  909.  
  910.    ---------------------------------------------------------------------------
  911.    WBrdrH procedure                                                       Wndw
  912.    ---------------------------------------------------------------------------
  913.    Function       Places a horizontal partition of the same type as the window 
  914.                   border from edge to edge of the border.
  915.    Declaration    WBrdrH (Row: byte)
  916.    Screens        All video pages and virtual screens.
  917.    Remarks        This routine divides a window using WSbrdr, BrdrAttr from 
  918.                   the top window record.  It provides a horizontal line 
  919.                   complete with a tee on each end using parts BrdrHL, BrdrLT, 
  920.                   and BrdrRT.  If SameAttr is used for BrdrAttr, then the 
  921.                   attributes will remain the same on the screen.  If there is 
  922.                   no border, the procedure is ignored.
  923.    EOS            Unaltered.
  924.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  925.    See also       WBrdrPart, WBrdrV, WLineH, WLinePart, WLineV
  926.  
  927.    ---------------------------------------------------------------------------
  928.    WBrdrPart procedure                                                    Wndw
  929.    ---------------------------------------------------------------------------
  930.    Function       Places a single border part of the same type as the window 
  931.                   border at a window-relative location.
  932.    Declaration    WBrdrPart (Row,Col: byte; Part: BrdrParts)
  933.    Screens        All video pages and virtual screens.
  934.    Remarks        This routine places the part using WSbrdr, BrdrAttr from the 
  935.                   top window record.  It is usually used for crosses or tees, 
  936.                   but there are 15 different parts that can be used.  If 
  937.                   SameAttr is used for BrdrAttr, then the attributes will 
  938.                   remain the same on the screen.  If there is no border, the 
  939.                   procedure is ignored.
  940.    EOS            Unaltered.
  941.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  942.    See also       WBrdrH, WBrdrPart, WLineH, WLineV, WLinePart
  943.  
  944.    ---------------------------------------------------------------------------
  945.    WBrdrV procedure                                                       Wndw
  946.    ---------------------------------------------------------------------------
  947.    Function       Places a vertical partition of the same type as the window 
  948.                   border from edge to edge of the border.
  949.    Declaration    WBrdrV (Row: byte)
  950.    Screens        All video pages and virtual screens.
  951.    Remarks        This routine divides a window using WSbrdr, BrdrAttr from 
  952.                   the top window record.  It provides a vertical line complete 
  953.                   with a tee on each end using parts BrdrVL, BrdrTT, and 
  954.  
  955.  
  956.    Chapter 2, Procedures and Functions                                 Page 16
  957.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  958.  
  959.  
  960.                   BrdrBT.  If SameAttr is used for BrdrAttr, then the 
  961.                   attributes will remain the same on the screen.  If there is 
  962.                   no border, the procedure is ignored.
  963.    EOS            Unaltered.
  964.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  965.    See also       WBrdrH, WBrdrPart, WLineH, WLineV, WLinePart
  966.  
  967.    ---------------------------------------------------------------------------
  968.    WClrEol procedure                                                      Wndw
  969.    ---------------------------------------------------------------------------
  970.    Function       Clears a row to End-Of-Line (EOL).
  971.    Declaration    WClrEol (Row,Col: byte; Attr: integer)
  972.    Screens        All video pages and virtual screens.
  973.    Remarks        The row is cleared using the attribute Attr (SameAttr is 
  974.                   permitted).  To force the window attribute, use 
  975.                   TWS.WndwAttr.
  976.    EOS            Set to (Row,Col).
  977.    Restrictions   Stay within window limits.
  978.    See also       WDelLine, WClrLine, WClrEos
  979.  
  980.    ---------------------------------------------------------------------------
  981.    WClrEos procedure                                                      Wndw
  982.    ---------------------------------------------------------------------------
  983.    Function       Clears a row from EOS to End-Of-Line.
  984.    Declaration    WClrEos (Attr: integer)
  985.    Screens        All video pages and virtual screens.
  986.    Remarks        The row is cleared starting at the EOS marker using the 
  987.                   attribute Attr (SameAttr is permitted).  To force the window 
  988.                   attribute, use TWS.WndwAttr.
  989.    EOS            Unaltered.
  990.    Restrictions   Stay within window limits.
  991.    See also       WDelLine, WClrLine, WClrEos
  992.  
  993.    ---------------------------------------------------------------------------
  994.    WClrField procedure                                                    Wndw
  995.    ---------------------------------------------------------------------------
  996.    Function       Clears a field.
  997.    Declaration    WClrField (Row,Col,Cols: byte; Attr: integer)
  998.    Screens        All video pages and virtual screens.
  999.    Remarks        The field is cleared starting at (Row,Col) using the 
  1000.                   attribute Attr (SameAttr is permitted).  To force the window 
  1001.                   attribute, use TWS.WndwAttr.
  1002.    EOS            Set to (Row,Col).
  1003.    Restrictions   Stay within window limits.
  1004.    See also       WClrEol, WClrEos, WClrFieldEos
  1005.  
  1006.    ---------------------------------------------------------------------------
  1007.    WClrFieldEos procedure                                                 Wndw
  1008.    ---------------------------------------------------------------------------
  1009.    Function       Clears a field starting at EOS.
  1010.    Declaration    WClrFieldEos (Cols: byte; Attr: integer)
  1011.    Screens        All video pages and virtual screens.
  1012.    Remarks        The field is cleared starting at EOS using the attribute 
  1013.                   Attr (SameAttr is permitted).  To force the window 
  1014.                   attribute, use TWS.WndwAttr.
  1015.  
  1016.  
  1017.    Chapter 2, Procedures and Functions                                 Page 17
  1018.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1019.  
  1020.  
  1021.    EOS            Unaltered.
  1022.    Restrictions   Stay within window limits.
  1023.    See also       WClrEol, WClrEos, WClrField
  1024.  
  1025.    ---------------------------------------------------------------------------
  1026.    WClrLine procedure                                                     Wndw
  1027.    ---------------------------------------------------------------------------
  1028.    Function       Clears a specified row.
  1029.    Declaration    WClrLine (Row: byte)
  1030.    Screens        All video pages and virtual screens.
  1031.    Remarks        The row is cleared using the window attribute TWS.WndwAttr 
  1032.                   (SameAttr is permitted).
  1033.    EOS            Set to (Row,1).
  1034.    Restrictions   Stay within window limits.
  1035.    See also       WDelLine, WClrEol, WClrEos
  1036.  
  1037.    ---------------------------------------------------------------------------
  1038.    WClrScr procedure                                                      Wndw
  1039.    ---------------------------------------------------------------------------
  1040.    Function       Clears the entire window.
  1041.    Declaration    WClrScr
  1042.    Screens        All video pages and virtual screens.
  1043.    Remarks        Clears the screen using the window attribute TWS.WndwAttr 
  1044.                   (SameAttr is permitted).
  1045.    EOS            Set to (1,1).
  1046.    See also       WClrLine, WDelLine, WInsLine
  1047.  
  1048.    ---------------------------------------------------------------------------
  1049.    WClrTitle procedure                                                    Wndw
  1050.    ---------------------------------------------------------------------------
  1051.    Function       Clears the titles from the specified row.
  1052.    Declaration    WClrTitle (TopOrBottomRow: DirType);
  1053.    Screens        All video pages and virtual screens.
  1054.    Remarks        Clears the top or bottom border where the titles are located 
  1055.                   and restores the original border if any.  If WSbrdr=NoBrdr, 
  1056.                   the row is simply cleared.  Works on both fixed and virtual 
  1057.                   titles.
  1058.    EOS            Unaltered.
  1059.    See also       TitleWindow, VUpdateTitle
  1060.  
  1061.    ---------------------------------------------------------------------------
  1062.    WDelLine procedure                                                     Wndw
  1063.    ---------------------------------------------------------------------------
  1064.    Function       Deletes a line at a specified row, scrolls up the remaining 
  1065.                   part of the window and clears the bottom row.
  1066.    Declaration    WInsLine (Row: byte)
  1067.    Screens        All video pages and virtual screens.
  1068.    Remarks        Similar to Turbo's DelLine, the indicated row of the window 
  1069.                   will be deleted.  The bottom row is cleared with WndwAttr 
  1070.                   (SameAttr is permitted).  The cursor is not moved, but is 
  1071.                   ready to be moved with WGotoEos as EOS is set to the first 
  1072.                   column of the cleared row.
  1073.    EOS            Updated to first cleared column of the cleared row.
  1074.    Restrictions   Stay within window limits.
  1075.    See also       WInsLine, WScrollUp, WGotoEos
  1076.  
  1077.  
  1078.    Chapter 2, Procedures and Functions                                 Page 18
  1079.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1080.  
  1081.  
  1082.  
  1083.    ---------------------------------------------------------------------------
  1084.    WGotoEos procedure                                                     Wndw
  1085.    ---------------------------------------------------------------------------
  1086.    Function       Positions the cursor to match the EOS marker on both fixed 
  1087.                   or virtual windows.
  1088.    Declaration    WGotoEos
  1089.    Screens        All video pages and virtual screens.
  1090.    Remarks        The cursor is simply moved to match the position of the EOS 
  1091.                   marker of the currently written video page.  TWS.WSwhereR 
  1092.                   and TWS.WSwhereC are also updated.  For virtual windows, 
  1093.                   this routine also executes VUpdateCursor.
  1094.    EOS            Unaltered.
  1095.    See also       WEosR, WEosC, WEosToRC, WEosLn, WGotoRC, VUpdateCursor
  1096.    Restrictions   EOS should be within window limits.
  1097.    Example        Center a string in a window and place the cursor at the end 
  1098.                   of the string:
  1099.  
  1100.                     WWriteC (1,'Correct (Y/N)? ');
  1101.                     WGotoEos;
  1102.  
  1103.    ---------------------------------------------------------------------------
  1104.    WGotoRC procedure                                                      Wndw
  1105.    ---------------------------------------------------------------------------
  1106.    Function       Positions the cursor relative to the window.
  1107.    Declaration    WGotoRC (Row, Col: byte)
  1108.    Screens        All video pages and virtual screens.
  1109.    Remarks        The cursor is positioned to the currently written window.  
  1110.                   For virtual windows, this routine also executes 
  1111.                   VUpdateCursor.
  1112.    EOS            Unaltered.
  1113.    Restrictions   Stay within the window limits.
  1114.    See also       GotoEos, WhereR, WhereC 
  1115.  
  1116.    ---------------------------------------------------------------------------
  1117.    WInsLine procedure                                                     Wndw
  1118.    ---------------------------------------------------------------------------
  1119.    Function       Inserts a blank line at a specified row using the window 
  1120.                   attribute WndwAttr scrolling down the remaining part.
  1121.    Declaration    WInsLine (Row: byte)
  1122.    Screens        All video pages and virtual screens.
  1123.    Remarks        Similar to Turbo's InsLine, the indicated row of the window 
  1124.                   is scrolled down and then cleared (SameAttr is permitted).  
  1125.                   The cursor is not moved, but is ready to be moved with 
  1126.                   WGotoEos as EOS is set to the first column of the cleared 
  1127.                   row.
  1128.    EOS            Updated to first cleared column of the cleared row.
  1129.    Restrictions   Stay within window limits.
  1130.    See also       WDelLine, WScrollDown, WGotoEos
  1131.  
  1132.    ---------------------------------------------------------------------------
  1133.    WLineH procedure                                                       Wndw
  1134.    ---------------------------------------------------------------------------
  1135.    Function       Places a horizontal line in the window using the window line 
  1136.                   set.
  1137.  
  1138.  
  1139.    Chapter 2, Procedures and Functions                                 Page 19
  1140.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1141.  
  1142.  
  1143.    Declaration    WLineH (Row,Col,Cols: byte)
  1144.    Screens        All video pages and virtual screens.
  1145.    Remarks        This routine divides a window using WSline, WndwAttr from 
  1146.                   the top window record.  It provides just a horizontal line 
  1147.                   using part BrdrHL.  If SameAttr is used for WndwAttr, then 
  1148.                   the attributes will remain the same on the screen.  If 
  1149.                   WSline=NoBrdr, then the procedure is ignored.
  1150.    EOS            Updated.
  1151.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1152.    See also       WBrdrH, WBrdrPart, WBrdrV, WLinePart, WLineV
  1153.  
  1154.    ---------------------------------------------------------------------------
  1155.    WLinePart procedure                                                    Wndw
  1156.    ---------------------------------------------------------------------------
  1157.    Function       Places a single line part of the same type as the window 
  1158.                   line set at a window-relative location.
  1159.    Declaration    WLinePart (Row,Col: byte; Part: BrdrParts)
  1160.    Screens        All video pages and virtual screens.
  1161.    Remarks        This routine places the part using WSline, WndwAttr from the 
  1162.                   top window record.  It is usually used for crosses or tees, 
  1163.                   but there are 15 different parts that can be used.  If 
  1164.                   SameAttr is used for WndwAttr, then the attributes will 
  1165.                   remain the same on the screen.  If WSline=NoBrdr, the 
  1166.                   procedure is ignored.
  1167.    EOS            Updated.
  1168.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1169.    See also       WBrdrH, WBrdrPart, WBrdrV, WLineH, WLineV
  1170.  
  1171.    ---------------------------------------------------------------------------
  1172.    WLineV procedure                                                       Wndw
  1173.    ---------------------------------------------------------------------------
  1174.    Function       Places a vertical line in the window using the window line 
  1175.                   set.
  1176.    Declaration    WLineV (Row,Col,Rows: byte)
  1177.    Screens        All video pages and virtual screens.
  1178.    Remarks        This routine divides a window using WSline, WndwAttr from 
  1179.                   the top window record.  It provides just a vertical line 
  1180.                   using part BrdrVL.  If SameAttr is used for WndwAttr, then 
  1181.                   the attributes will remain the same on the screen.  If 
  1182.                   WSline=NoBrdr, then the procedure is ignored.
  1183.    EOS            Updated.
  1184.    Restrictions   Stay within window limits.  Cannot use NoBrdr.
  1185.    See also       WBrdrH, WBrdrPart, WBrdrV, WLineH, WLinePart
  1186.  
  1187.    ---------------------------------------------------------------------------
  1188.    WriteAndViewPage procedure                                             Wndw
  1189.    ---------------------------------------------------------------------------
  1190.    Function       Changes the video page to be both viewed and written on the 
  1191.                   CRT.
  1192.    Declaration    WriteAndViewPage (PageNum: byte)
  1193.    Screens        All video pages.
  1194.    Remarks        If another video page is available, this routine will switch 
  1195.                   to both view and write to that page.  It does nothing if 
  1196.                   PageNum is already the currently written video page 
  1197.                   (QvideoPage) and viewed page (VideoPage), or if PageNum is 
  1198.  
  1199.  
  1200.    Chapter 2, Procedures and Functions                                 Page 20
  1201.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1202.  
  1203.  
  1204.                   invalid.  All WndwStats are swapped to exact same conditions 
  1205.                   as before.
  1206.    EOS            Restored to new page.
  1207.    See also       WriteToPage, Qwik.QviewPage, Qwik.QwritePage
  1208.  
  1209.    ---------------------------------------------------------------------------
  1210.    WriteToCRT procedure                                                  Wndw
  1211.    ---------------------------------------------------------------------------
  1212.    Function       Prepares QWIK and WNDW to write to the top window on the CRT 
  1213.                   and restores the Turbo window.
  1214.    Declaration    WriteToCRT
  1215.    Screens        Back to any video page.
  1216.    Remarks        This procedure switches back to writing to the top window on 
  1217.                   the CRT after writing to a hidden window or virtual screen.
  1218.    EOS            Restored to top window.
  1219.    See also       WriteToHidden, WriteToVirtual
  1220.  
  1221.    ---------------------------------------------------------------------------
  1222.    WriteToHidden procedure                                                Wndw
  1223.    ---------------------------------------------------------------------------
  1224.    Function       Prepares QWIK and WNDW to write to a hidden window.
  1225.    Declaration    WriteToHidden (WindowName: WindowNames)
  1226.    Remarks        This procedure switches to writing to a hidden window.  The 
  1227.                   window must be a valid window name, otherwise the program is 
  1228.                   terminated with an error message.
  1229.    EOS            Restored to hidden window.
  1230.    See also       WriteToCRT, WriteToVirtual
  1231.  
  1232.    ---------------------------------------------------------------------------
  1233.    WriteToPage procedure                                                 Wndw
  1234.    ---------------------------------------------------------------------------
  1235.    Function       Changes the video page on which the WNDW routines write with 
  1236.                   out changing the viewed page.
  1237.    Declaration    WriteToPage (PageNum: byte)
  1238.    Screens        All video pages.
  1239.    Remarks        If another video page is available, this routine will switch 
  1240.                   to write to that page.  It does nothing if PageNum is 
  1241.                   already the currently written video page (QvideoPage) or if 
  1242.                   the page is invalid.  All WndwStats are swapped to exact 
  1243.                   same conditions as before.
  1244.    EOS            Restored to new page.
  1245.    See also       WriteAndViewPage, Qwik.QwritePage
  1246.  
  1247.    ---------------------------------------------------------------------------
  1248.    WriteToVirtual procedure                                               Wndw
  1249.    ---------------------------------------------------------------------------
  1250.    Function       Prepares QWIK and WNDW to write to a virtual screen.
  1251.    Declaration    WriteToVirtual (WindowName: WindowNames)
  1252.    Remarks        This procedure switches to writing to a virtual screen.  The 
  1253.                   window must be a valid window name, otherwise, the program 
  1254.                   is terminated with an error message.
  1255.    EOS            Restored to virtual screen.
  1256.    See also       WriteToCRT, WriteToHidden
  1257.  
  1258.  
  1259.  
  1260.  
  1261.    Chapter 2, Procedures and Functions                                 Page 21
  1262.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1263.  
  1264.  
  1265.    ---------------------------------------------------------------------------
  1266.    WScrollDown procedure                                                  Wndw
  1267.    ---------------------------------------------------------------------------
  1268.    Function       Scrolls the current window down and clears the top row with 
  1269.                   the window attribute WndwAttr.
  1270.    Declaration    WScrollDown
  1271.    Screens        All video pages and virtual screens.
  1272.    Remarks        The last row of the window will be scrolled out and lost 
  1273.                   while the first row will be cleared (SameAttr is permitted).  
  1274.                   The cursor is not moved, but is ready to be moved with 
  1275.                   WGotoEos as EOS is set to the first column of the cleared 
  1276.                   row.
  1277.    EOS            Updated to first cleared column of the cleared row.
  1278.    Restrictions   None.
  1279.    See also       WScrollUp, WGotoEos
  1280.  
  1281.    ---------------------------------------------------------------------------
  1282.    WScrollUp procedure                                                    Wndw
  1283.    ---------------------------------------------------------------------------
  1284.    Function       Scrolls the current window up and clears the bottom row with 
  1285.                   the window attribute WndwAttr.
  1286.    Declaration    WScrollUp 
  1287.    Screens        All video pages and virtual screens.
  1288.    Remarks        The first row of the window will be scrolled out and lost 
  1289.                   while the last row will be cleared (SameAttr is permitted).  
  1290.                   The cursor is not moved, but is ready to be moved with 
  1291.                   WGotoEos as EOS is set to the first column of the cleared 
  1292.                   row.
  1293.    EOS            Updated to first cleared column of the cleared row.
  1294.    Restrictions   None.
  1295.    See also       WScrollDown, WGotoEos
  1296.  
  1297.    ---------------------------------------------------------------------------
  1298.    WWhereC function                                                       Wndw
  1299.    ---------------------------------------------------------------------------
  1300.    Function       Returns the window-relative column of the cursor on the 
  1301.                   currently written video page.
  1302.    Declaration    WWhereC
  1303.    Result type    byte
  1304.    Screens        All video pages only.
  1305.    Remarks        Operates on the currently written video page.  The upper 
  1306.                   left corner of the screen is (1,1). 
  1307.    See also       WGotoRC, WWhereR
  1308.  
  1309.    ---------------------------------------------------------------------------
  1310.    WWhereR function                                                       Wndw
  1311.    ---------------------------------------------------------------------------
  1312.    Function       Returns the window-relative row of the cursor on the 
  1313.                   currently written video page.
  1314.    Declaration    WWhereR
  1315.    Result type    byte
  1316.    Screens        All video pages only.
  1317.    Remarks        Operates on the currently written video page.  The upper 
  1318.                   left corner of the screen is (1,1). 
  1319.    See also       WGotoRC, WWhereC
  1320.  
  1321.  
  1322.    Chapter 2, Procedures and Functions                                 Page 22
  1323.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1324.  
  1325.  
  1326.  
  1327.    ---------------------------------------------------------------------------
  1328.    WWrite procedure                                                       Wndw
  1329.    ---------------------------------------------------------------------------
  1330.    Function       Writes a string relative to the current window using the 
  1331.                   window attribute.
  1332.    Declaration    WWrite (Row,Col: byte; aStr: string)
  1333.    Screens        All video pages and virtual screens.
  1334.    Remarks        This routine writes the string aStr at window-relative 
  1335.                   (Row,Col) with the attribute WndwAttr from the window 
  1336.                   record.  If SameAttr is used for WndwAttr, then the 
  1337.                   attributes will remain the same on the screen.
  1338.    EOS            Updated.
  1339.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1340.                   around to column 1.
  1341.    See also       WWriteC, WWriteA
  1342.    Example        Write the string "Enter" at (2,1) with the current window 
  1343.                   attribute:
  1344.  
  1345.                     WWrite (2,1,'Enter');
  1346.  
  1347.    Example        Write the string "Answer" at (2,1) with the attribute of 
  1348.                   flashing white on red and then restore the current window 
  1349.                   attribute:
  1350.  
  1351.                     with TopWndwStat do
  1352.                       begin
  1353.                         WndwAttr := Blink+White+RedBG;
  1354.                         Wwrite (2,1,'Answer');
  1355.                         WndwAttr := OrigAttr;
  1356.                       end;
  1357.  
  1358.    ---------------------------------------------------------------------------
  1359.    WWriteA procedure                                                      Wndw
  1360.    ---------------------------------------------------------------------------
  1361.    Function       Writes an array (or string) with a specified length relative 
  1362.                   to the current window using the window attribute.
  1363.    Declaration    WWriteA (Row,Col: byte; ArrayLength: word; VAR aStr)
  1364.    Screens        All video pages and virtual screens.
  1365.    Remarks        This routine writes the array aStr at window-relative 
  1366.                   (Row,Col) for the number of columns specified by 
  1367.                   ArrayLength.  This enables you to write substrings when 
  1368.                   specifying a starting index (aStr[i]).  (Other routines like 
  1369.                   WWrite assume the length is the value at aStr[0] and the 
  1370.                   starting index is aStr[1].)  Of course, aStr doesn't have to 
  1371.                   be a string - it can be any type variable or address in 
  1372.                   memory.  The attribute used is WndwAttr from the window 
  1373.                   record.  If SameAttr is used for WndwAttr, then the 
  1374.                   attributes will remain the same on the screen.
  1375.    EOS            Updated.
  1376.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1377.                   around to column 1.
  1378.    See also       WWrite, WWriteC
  1379.    Example        The following will write "Testing out this line."  with the 
  1380.                   current window attribute:
  1381.  
  1382.  
  1383.    Chapter 2, Procedures and Functions                                 Page 23
  1384.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1385.  
  1386.  
  1387.  
  1388.                      MyString:='Step B: Testing out this line.';
  1389.                      WWriteA (1,1,22,MyString[9]);
  1390.  
  1391.    ---------------------------------------------------------------------------
  1392.    WWriteC procedure                                                      Wndw
  1393.    ---------------------------------------------------------------------------
  1394.    Function       Writes a string centered column-wise to the current window 
  1395.                   using the window attribute.
  1396.    Declaration    WWriteC (Row: byte; aStr: string)
  1397.    Screens        All video pages and virtual screens.
  1398.    Remarks        This routine writes the string aStr centered between the 
  1399.                   left and right columns of the window.  The attribute used is 
  1400.                   WndwAttr from the window record.  If SameAttr is used for 
  1401.                   WndwAttr, then the attributes will remain the same on the 
  1402.                   screen.
  1403.    EOS            Updated.
  1404.    Restrictions   Stay within the window limits.  Long strings will not wrap 
  1405.                   around to column 1.
  1406.    See also       WWrite, WWriteA
  1407.    Example        Write a message centered in a window on row 5:
  1408.  
  1409.                     WWriteC (5,'My message'); 
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.    Chapter 2, Procedures and Functions                                 Page 24
  1445.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1446.  
  1447.  
  1448.    3.  D A T A   S T R U C T U R E
  1449.  
  1450.    This section will help describe the data structure of WNDW and how it can 
  1451.    be adjusted.  The variables in W5X-VAR.INC are allocated according to the 
  1452.    conditional directives and constants set at the beginning of the file.  
  1453.    There are several basic variables, but if desired, there are additional 
  1454.    variables for virtual windows and multiple video pages.  Please refer to 
  1455.    the source code in W5X-VAR.INC for the exact listing.
  1456.  
  1457.  
  1458.    BASIC TYPES
  1459.  
  1460.    Basic Types - These types are used for all windows and modes to define the 
  1461.    data structure.  This will describe the purpose of each type.
  1462.  
  1463.      Type          Description
  1464.      ------------  -----------------------------------------------------------
  1465.      Borders       This enumerated type gives a name for 15 different border 
  1466.                    styles each having 15 different parts already assigned in 
  1467.                    the constant array Brdr.  The name NoBrdr is reserved.
  1468.  
  1469.                      NoBrdr         - No border at all.  Just the text area.
  1470.                      BlankBrdr      - Blank character on all sides.
  1471.                      SingleBrdr     - Single lines on all sides.
  1472.                      DoubleBrdr     - Double lines on all sides.
  1473.                      HdoubleBrdr    - Horizontal double lines.  Single 
  1474.                                       vertical lines.
  1475.                      VdoubleBrdr    - Vertical double lines.  Single 
  1476.                                       horizontal lines.
  1477.                      SolidBrdr      - Solid box character on all sides.
  1478.                      EvenSolidBrdr  - Vertical solid box.  Horizontal half 
  1479.                                       box.
  1480.                      ThinSolidBrdr1 - Half box on all sides.  Squeezed 
  1481.                                       horizontally.
  1482.                      ThinSolidBrdr2 - Half box on all sides.  Squeezed 
  1483.                                       vertically.
  1484.                      LhatchBrdr     - Light hatch character on all sides.
  1485.                      MhatchBrdr     - Medium hatch character on all sides.
  1486.                      HhatchBrdr     - Heavy hatch character on all sides.
  1487.                      UserBrdr1      - User defined border.
  1488.                      UserBrdr2      - User defined border.
  1489.  
  1490.      BrdrParts     Each border has 15 different parts.  This enumerated type 
  1491.                    identifies each part by name.  Using acronyms, the relative 
  1492.                    position can be easily identified.  For example, BrdrTL 
  1493.                    means the Top Left border part.  The order corresponds with 
  1494.                    the BrdrRec type:
  1495.  
  1496.                      Relative Position      The first letter means:
  1497.                      ------------------        T = Top         B = Bottom
  1498.                      TL  TH  TT  TH  TR        V = Vertical    H = Horizontal
  1499.                      LV      VL      RV        L = Left        R = Right
  1500.                      LT  HL  CL  HL  RT        C = Cross
  1501.                      LV      VL      RV     Second letter exceptions:
  1502.                      BL  BH  BT  BH  BR        T = Tee         L = Line
  1503.  
  1504.  
  1505.    Chapter 3, Data Structure                                           Page 25
  1506.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1507.  
  1508.  
  1509.  
  1510.      BrdrRec       This type provides the structure for each border style to 
  1511.                    access all 15 different parts.  By having a tag field, two 
  1512.                    different methods can be used to address the parts.
  1513.  
  1514.      DirType       This enumerated type identifies various directions.  They 
  1515.                    can be extended.
  1516.  
  1517.      MarginRec     Groups the margins used for moving or resizing windows.
  1518.  
  1519.      WindowNames   This enumerated type gives a name or handle for each window 
  1520.                    to uniquely identify a window record for random access.  
  1521.                    Any additional name can be used, but three are reserved: 
  1522.  
  1523.                      Name       Description
  1524.                      ---------- ---------------------------------------------
  1525.                      Window0    Identifies the initial base screen and must be 
  1526.                                 first in the list.
  1527.                      FreeWindow Identifies virtual screen records that are 
  1528.                                 free to be overwritten.
  1529.                      aWindow    A generic name to be used when the window does 
  1530.                                 not need to be unique.  It is usually used for 
  1531.                                 temporary windows like error messages.
  1532.  
  1533.  
  1534.      WndwStatType  This type sets up the basic structure to a window record.  
  1535.                    Each field in record is worth describing.  The WS prefix is 
  1536.                    an acronym meaning WndwStat.  There is 50 bytes per record.
  1537.  
  1538.                      WSrow .. WScol2 - These variables identify the location 
  1539.                      and size of the window INCLUDING the border if any.  The 
  1540.                      "2" suffix means the right column or bottom row location.
  1541.  
  1542.                      Wrow .. Wcol2 - These variables identify the location 
  1543.                      and size of the window EXCLUDING the border if any.  The 
  1544.                      "2" suffix means the right column or bottom row location.
  1545.  
  1546.                      WndwAttr/BrdrAttr/OrigAttr - These the attributes for the 
  1547.                      window and border respectively.  The value can even be 
  1548.                      SameAttr.  OrigAttr is a second copy of WndwAttr used to 
  1549.                      restore WndwAttr to its original value.
  1550.  
  1551.                      WSbrdr/WSline - The former is the current border style 
  1552.                      while the latter is a line set that can be used within 
  1553.                      the window.  When a window is made, these two values are 
  1554.                      the same, but WSline is available to be changed to the 
  1555.                      needed line set.
  1556.  
  1557.                      WSname - The unique name assigned to the window record.
  1558.  
  1559.                      WSwhereR/WSwhereC - These variables save the window-
  1560.                      relative row and column of the cursor.
  1561.  
  1562.                      WSmodes - Saves all the modes that created the window 
  1563.                      including the current status.
  1564.  
  1565.  
  1566.    Chapter 3, Data Structure                                           Page 26
  1567.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1568.  
  1569.  
  1570.  
  1571.                      WScursor - Save the cursor mode used with this window.
  1572.  
  1573.                      ULcol .. ULbytes - Saves the location and size of the 
  1574.                      underlay of a window including the border and shadow if 
  1575.                      any.
  1576.  
  1577.                      ULptr - Points to the saved underlay in the heap.
  1578.  
  1579.                      VScrRec - Holds the QWIK screen data for this window.
  1580.  
  1581.                      RefRow/RefCol - These two scratch coordinates are used 
  1582.                      for two cases.  It saves the absolute row/col where a 
  1583.                      window is positioned before it is hidden.  For virtual 
  1584.                      screen stats, it saves the view reference point.
  1585.  
  1586.                      ViewBrdr - Saves the border style originally created with 
  1587.                      the window.  WSbrdr differs from ViewBrdr in that WSbrdr 
  1588.                      contains the current border.  For virtual screens, WSbrdr 
  1589.                      is always NoBrdr even though the view on the CRT may be a 
  1590.                      different style.
  1591.  
  1592.                      VI - Virtual screen index for its associated virtual 
  1593.                      window stat if any.
  1594.  
  1595.      WndwStatsType  Sets up the total number of WndwStat records for the 
  1596.                    program which defined by the constant MaxWndw.
  1597.  
  1598.      VirtualStatsType  Sets up the total number of VirtualStat records for the 
  1599.                    program which defined by the constant MaxVirtualWndw.
  1600.  
  1601.      WordArray     Used to identify each Character/Attribute combination from 
  1602.                    a screen.  The range of the array is irrelevant.
  1603.  
  1604.      WordArrayPtrType  A pointer of WordArray.
  1605.  
  1606.  
  1607.    TYPED CONSTANTS
  1608.  
  1609.    Typed Constants - These constants set defaults used to create window 
  1610.    borders, shadows and titles.
  1611.  
  1612.      Constant      Description
  1613.      ------------  -----------------------------------------------------------
  1614.      Brdr          Contains 14 different border styles each with 15 border 
  1615.                    parts.  The flexible data structure enables you to get 
  1616.                    parts with either of two methods - by field identifier or 
  1617.                    by index name.  For example, it is easiest to use the field 
  1618.                    identifier: 
  1619.  
  1620.                      MyPart := Brdr[SingleBrdr].TL
  1621.  
  1622.                    Since field identifiers can't be passed as parameters, the 
  1623.                    index names must be used.  To get the same result if the 
  1624.                    name BrdrTL is passed as a value:
  1625.  
  1626.  
  1627.    Chapter 3, Data Structure                                           Page 27
  1628.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1629.  
  1630.  
  1631.  
  1632.                      MyPart := Brdr[SingleBrdr].BrdrArray[BrdrTL]
  1633.  
  1634.                    Both methods use the same code; the former is simply easier 
  1635.                    to write.
  1636.  
  1637.      ShadowChar    This is the character used to produce a shadow which is 
  1638.                    set equal to a space.  This may not be desirable for 
  1639.                    monochrome monitors which may look better with hatch 
  1640.                    characters.
  1641.  
  1642.      ShadowColor   This is the attribute used to produce a shadow which is set 
  1643.                    to Black on Black.  Any attribute can be used.
  1644.  
  1645.      TitleOfs      When writing titles, this offset is used to adjust where 
  1646.                    the title starts writing.  Left justified titles start 
  1647.                    at Wcol+TitleOfs while the Right end at Wcol2-TitleOfs.  
  1648.                    Center justified titles are not affected.  The default is 
  1649.                    1.  
  1650.  
  1651.  
  1652.    UNTYPED CONSTANTS
  1653.  
  1654.    Untyped Constants - These constants are used to control the data structure 
  1655.    size or to conveniently set window mode bits.
  1656.  
  1657.      Constant        Value  Description
  1658.      --------------  -----  --------------------------------------------------
  1659.      MaxWndw         1-254  Set by the user, this value determines the maximum 
  1660.                             number of windows that can be on the CRT on any 
  1661.                             video page.  This sets the amount of global data 
  1662.                             to be used.
  1663.  
  1664.      MaxVirtualWndw  0-254  Set by the user, this value determines the total
  1665.                             number of virtual screens minus one that will be 
  1666.                             maintained at any one time.  If no virtual windows 
  1667.                             are wanted, undefine the directive AddVirtual.
  1668.  
  1669.      MaxPageUsed     0 - 7  Set by the user, this value determines the highest 
  1670.                             page number to be managed in a multi-page program.  
  1671.                             If only page 0 is going to be used (which is 
  1672.                             usually the case), then undefine the directive 
  1673.                             MultiPage.  This will reduce the global data by a 
  1674.                             significant amount.
  1675.  
  1676.    Window Modes - There are several window modes and combination of modes that 
  1677.    can be set using SetWindowModes which is saved in the variable WindowModes.  
  1678.    This is a list of those modes, values and descriptions.  After the window 
  1679.    is created, the modes are saved in WSmodes as well as the "To*" modes which 
  1680.    indicates the status of the window.
  1681.  
  1682.      Constant        Value  Description
  1683.      --------------  -----  --------------------------------------------------
  1684.      RelMode         $0001  (Bit 0) Simply overwrites the screen relative to 
  1685.                             the current window.  The Row/Col coordinate is 
  1686.  
  1687.  
  1688.    Chapter 3, Data Structure                                           Page 28
  1689.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1690.  
  1691.  
  1692.                             window relative.  Works and stays in the current 
  1693.                             WriteTo mode.  This is usually used for flexible 
  1694.                             screen design.  The stats are only temporary and 
  1695.                             lost after changing windows.  To get back to the 
  1696.                             parent window, use RemoveWindow.
  1697.      PermMode        $0002  (Bit 1) Makes the window permanent on the screen - 
  1698.                             no underlay is saved.  These windows must be the 
  1699.                             first ones created.  They can be accessed, but be 
  1700.                             sure no other window is covering it (WI<=PLI) 
  1701.                             because they are not necessarily the top window.
  1702.                             before writing to the screen.
  1703.      ShadowLeft      $0004  (Bit 2) Places a shadow on the left side.
  1704.      ShadowRight     $0008  (Bit 3) Places a shadow on the right side.
  1705.      ZoomMode        $0010  (Bit 4) Creates a zoom effect with MakeWindow, 
  1706.                             ShowWindow, and AccessWindow.
  1707.      HiddenMode      $0020  (Bit 5) Creates the window as hidden.
  1708.      VirtualMode     $0040  (Bit 6) Creates a virtual window with a virtual 
  1709.                             screen.
  1710.      CursorOffMode   $0080  (Bit 7) Always leaves cursor off.
  1711.      SeeThruMode     $0100  (Bit 8) Doesn't clear screen inside the border and 
  1712.                             ignores ZoomMode.
  1713.      NoHideMode      $0200  (Bit 9) Ignores request to hide window.
  1714.      NoAccessMode    $0400  (Bit 10) Ignores request to access window.
  1715.      NoMoveMode      $0800  (Bit 11) Ignores request to move/resize window.
  1716.      ToCRTmode       $1000  (Bit 12) Indicates writing to CRT.
  1717.      ToHiddenMode    $2000  (Bit 13) Indicates writing to hidden window.
  1718.      ToVirtualMode   $4000  (Bit 14) Indicates writing to virtual screen.
  1719.  
  1720.  
  1721.    GLOBAL VARIABLES
  1722.  
  1723.    Global Variables - Finally, the variables used in WNDW can be described in 
  1724.    detail and can be accessed by the user.
  1725.  
  1726.    Window Flags - While writing to a window, it is difficult to try to analyze 
  1727.    the bits in WSmodes to figure out its modes.  So, each mode has been given 
  1728.    a corresponding boolean flag.  These flags are set for the current window.  
  1729.    Though rather intuitive, the flag variables is listed below with its 
  1730.    corresponding mode:
  1731.  
  1732.      Flag            Mode                
  1733.      --------------  --------------
  1734.      RelFlag         RelMode
  1735.      PermFlag        PermMode      
  1736.      ZoomFlag        ZoomMode
  1737.      HiddenFlag      HiddenMode    
  1738.      VirtualFlag     VirtualMode   
  1739.      CursorOffFlag   CursorOffMode
  1740.      SeeThruFlag     SeeThruMode   
  1741.      NoHideFlag      NoHideMode    
  1742.      NoAccessFlag    NoAccessMode  
  1743.      NoMoveFlag      NoMoveMode    
  1744.      ToCRTflag       ToCRTmode     
  1745.      ToHiddenFlag    ToHiddenMode  
  1746.      ToVirtualFlag   ToVirtualMode 
  1747.  
  1748.  
  1749.    Chapter 3, Data Structure                                           Page 29
  1750.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1751.  
  1752.  
  1753.  
  1754.    Single Page Variables - The following variables are grouped together 
  1755.    because they are specific to the current video page being used.  If you do 
  1756.    use more than one page, these variables will be swapped with another page.
  1757.  
  1758.      Variable        Description
  1759.      --------------  ---------------------------------------------------------
  1760.      WndwStat        (Type: WndwStatsType)  This is the array for the maximum 
  1761.                      number of windows both hidden and shown at one time.  
  1762.                      Each record only uses 52 bytes of global data.  
  1763.                      WndwStat[0] is always the record for the initial window.
  1764.  
  1765.      TopWndwStat     (Type: WndwStatsType)  This record makes it easy to always 
  1766.                      access the data for the current window and is always up 
  1767.                      to date.  This data will be saved in the correct WndwStat 
  1768.                      before accessing another window.
  1769.  
  1770.      TWS             (Type: WndwStatsType)  This is the same as TopWndwStat, 
  1771.                      but just easier to write.
  1772.  
  1773.      TopVirtualStat  (Type: WndwStatsType)  For virtual windows, in addition to 
  1774.                      TWS, there is the TopVirtualStat for the associated 
  1775.                      virtual screen which has its own record.
  1776.  
  1777.      TVS             (Type: WndwStatsType)  This is the same as TopVirtualStat, 
  1778.                      but just easier to write.  Keep in mind that when writing 
  1779.                      direct to the virtual screen (WriteToVirtual), TWS and 
  1780.                      TVS are reversed.  It would then be helpful to think of 
  1781.                      TVS as the top VIEW stat, since the view is on the CRT.
  1782.  
  1783.      LI              (Type: Word)  This is the top Level Index for the top 
  1784.                      window currently shown on the CRT.  Windows shown on the 
  1785.                      CRT are sequentially stacked from index 0 upward.
  1786.  
  1787.      HLI             (Type: Word)  This is the Hidden Level Index which are 
  1788.                      stacked from index equal to MaxWndw downward.  If there 
  1789.                      are no hidden windows, HLI=MaxWndw+1.
  1790.  
  1791.      WI              (Type: Word)  For the current Window Index, the program 
  1792.                      saves and retrieves the WndwStat from this index whether 
  1793.                      it is hidden or shown.  It ranges from 0 to MaxWndw.  For 
  1794.                      hidden windows, can range from HLI to MaxWndw.  For the 
  1795.                      top window on the CRT, WI=LI.  For PermMode windows, it 
  1796.                      can be <=LI.
  1797.  
  1798.      PLI             (Type: Byte)  This Permanent Level Index keeps track of 
  1799.                      the order of the permanent windows on the CRT.  They must 
  1800.                      be stacked contiguously as the first ones on the CRT or 
  1801.                      else an error message will be displayed.  This value is 
  1802.                      <=LI.
  1803.  
  1804.      CursorDefault   (Type: word)  This is the value saved from 
  1805.                      SetCursorDefault for the cursor mode which can be just as 
  1806.                      easily set directly.  When MakeWindow is used, this is 
  1807.                      the value saved for that window.
  1808.  
  1809.  
  1810.    Chapter 3, Data Structure                                           Page 30
  1811.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1812.  
  1813.  
  1814.  
  1815.      Margins         (Type: MarginRec)  These margins limit the moving or 
  1816.                      resizing of windows for each video page.  This prevents 
  1817.                      windows from covering status lines or the like.
  1818.  
  1819.      WindowModes     (Type: word)  This is the value saved from 
  1820.                      SetWindowModes.  It is best to use the procedure for this 
  1821.                      value since it filters out incompatible modes.
  1822.  
  1823.      TopPageStat    (Type: PageStatRec)  Rather than being redundant, the 
  1824.                      above ten variables for a single page are all contained 
  1825.                      in this record.  This makes it easy to swap data with 
  1826.                      other page.  This is the data currently being used on the 
  1827.                      screen.
  1828.  
  1829.    Universal Variables - These variables are not specific to any window or 
  1830.    video page and are used universally in the program.
  1831.  
  1832.      Variable        Description
  1833.      --------------  ---------------------------------------------------------
  1834.      VirtualRows     (Type: byte)  This is the row height saved from 
  1835.                      SetVirtualSize setting the number of rows used in the 
  1836.                      virtual screen.  The default is CRTrows.
  1837.  
  1838.      VirtualCols     (Type: byte)  This is the column width saved from 
  1839.                      SetVirtualSize setting the number of columns used in the 
  1840.                      virtual screen.  The default is CRTcols.
  1841.  
  1842.      VirtualSize     (Type: word)  This is the size in bytes to be reserved 
  1843.                      for the virtual screen.  The size is VirtualCols * 
  1844.                      (VirtualRows+2) * 2.  Remember the last two rows are 
  1845.                      added for the virtual titles.
  1846.  
  1847.      MaxValidPage    (Type: byte)  The program can reserve enough data for all 
  1848.                      video pages being address with MaxPageUsed.  However, the 
  1849.                      machine that runs the program must have those pages 
  1850.                      available.  This variable additionally limits the pages 
  1851.                      that can be addressed which is the lesser of MaxPage or 
  1852.                      MaxPageUsed.
  1853.  
  1854.      ZoomDelay       (Type: byte)  This value is set by InitWindow to control 
  1855.                      the zoom rate on non-snowing video cards.  This value is 
  1856.                      set according to the CpuID.
  1857.  
  1858.      AddrGoof        (Type: pointer)  This points to the ShowGoof procedure in 
  1859.                      the Goof unit to display fatal errors.
  1860.  
  1861.  
  1862.    DYNAMIC VARIABLES
  1863.  
  1864.    Dynamic Variables - These variables are allocated to the heap to leave more 
  1865.    room for global variables.  They are allocated in InitWindow.
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.    Chapter 3, Data Structure                                           Page 31
  1872.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1873.  
  1874.  
  1875.      Pointer         Description
  1876.      --------------  ---------------------------------------------------------
  1877.      VirtualStat     (Type: ^WndwStatType)  This array of window records is 
  1878.                      for the virtual screens associated with the virtual 
  1879.                      windows.  All routines use this data when writing to 
  1880.                      virtual screens by copying it to TWS.  The index for this 
  1881.                      record is obtain from TWS.VI.  Since this array is filled 
  1882.                      at random, VI does not correspond to WI.  When a virtual 
  1883.                      window is removed, these stats are "freed" by renaming 
  1884.                      WSname to FreeWindow - they are not freed by FreeMem.  
  1885.                      All video pages use this one array.
  1886.  
  1887.      PageStat        (Type: ^PageStatRec)  If your program uses multiple video 
  1888.                      pages, a complete record of all the window records and 
  1889.                      indexes are saved for each video page.  These can be 
  1890.                      easily swapped with TopPageStat to work on the current 
  1891.                      video page.  The WriteToPage procedure handles this 
  1892.                      operation.
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.  
  1929.  
  1930.  
  1931.  
  1932.    Chapter 3, Data Structure                                           Page 32
  1933.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1934.  
  1935.  
  1936.    A P P E N D I X  A :   M E M O R Y   A L L O C A T I O N
  1937.  
  1938.    This section covers the memory requirements for global data in the data 
  1939.    segment and dynamic data in the heap.  This will give you the figures on 
  1940.    how to calculate the memory needed for your program.
  1941.  
  1942.  
  1943.    GLOBAL MEMORY
  1944.  
  1945.    Global Memory - WNDW is very frugal with global data.  Here is the 
  1946.    breakdown on the fixed amount of data required:
  1947.  
  1948.      Variables                       Bytes
  1949.      ------------------------------- -----
  1950.      Border array constants            210
  1951.      Basic windows                     142
  1952.      Additional for virtual windows     69
  1953.      Additional for multi-page video     4
  1954.                                      -----
  1955.      Fixed allocation                  425
  1956.  
  1957.    The additional for virtual windows and multi-page video can be deleted with 
  1958.    directives if not used.  This is the allocation for MaxWndw=0.  For each 
  1959.    additional window record, add 52 bytes.  So, for MaxWndw=10, the allocation 
  1960.    would be (52*10)+425=945 bytes.
  1961.  
  1962.  
  1963.    DYNAMIC MEMORY
  1964.  
  1965.    Dynamic Variables - To alleviate using global data, dynamic variables are 
  1966.    used for permanent and temporary use.  The allocation for virtual screen 
  1967.    records and video page records are permanent throughout the program.  Many 
  1968.    other procedures such as MoveWindow temporarily use the heap to perform 
  1969.    operations.
  1970.  
  1971.    Permanent Variables - If the directives have been defined, the following 
  1972.    allocation can be calculated:
  1973.  
  1974.      Variables       Bytes
  1975.      --------------- -------------------------------
  1976.      VirtualStat     52 per virtual window
  1977.      PageStat        (SizeOf(TopPageStat)) per video page
  1978.      Virtual screen  VirtualSize
  1979.  
  1980.    Virtual screens are kept in memory until RemoveWindow is used.
  1981.  
  1982.    Temporary Variables - For procedures that temporarily use the heap, the 
  1983.    size of allocation is listed along with each procedure in section 2 above.  
  1984.    Generally, you should allow about the same size as 3 CRT screens of 
  1985.    available Heap for those procedures.  For a video mode with 25 rows and 80 
  1986.    columns, this is (80*25*2)*3=12000 bytes.  This should be added in addition 
  1987.    to the random allocation.
  1988.  
  1989.    Random Allocation - Because of the nature of random access to windows and 
  1990.    underlays, the program uses GetMem and FreeMem.  This means that there are 
  1991.  
  1992.  
  1993.    Appendix A: Memory Allocation                                       Page 33
  1994.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  1995.  
  1996.  
  1997.    going to be gaps of free memory in the heap.  To account for this, you 
  1998.    should more than double the amount of data expected for underlays and 
  1999.    virtual screens.  It is up to you to judge just how must of the heap is 
  2000.    going to be truly random.  In the case of simple serial-access to windows, 
  2001.    the heap will be contiguous and doubling of the heap is unnecessary.
  2002.  
  2003.  
  2004.    CODE SIZE
  2005.  
  2006.    Code Size - WNDW is also very frugal with with code.  Here is the 
  2007.    breakdown for code usage (this may vary slightly):
  2008.  
  2009.      Code Description                Bytes
  2010.      ------------------------------- -----
  2011.      Basic windows                    8656
  2012.      Additional for virtual windows   3808
  2013.      Additional for multi-page video   256
  2014.                                      -----
  2015.      Total code                      12720
  2016.  
  2017.    Of course the TP4 smart compiler will optimize the code leaving out unused 
  2018.    procedures.  But this gives you a good idea of how small the code really 
  2019.    is!
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.    Appendix A: Memory Allocation                                       Page 34
  2055.    WNDW Multi-level Virtual Windows               Reference Guide, Version 5.X 
  2056.  
  2057.  
  2058.    A P P E N D I X  B :   E R R O R   M E S S A G E S
  2059.  
  2060.    Because WNDW is so powerful, it writes to screen in memory as well as the 
  2061.    CRT.  Should you make a mistake in programming, it may not show up on the 
  2062.    CRT screen.  So, to prevent the errors before they happen, programs written 
  2063.    with errors will terminate with an error message window on the CRT to 
  2064.    reveal the problem.  The program terminates through the GOOF unit which can 
  2065.    be freely edited.
  2066.  
  2067.    "Not enough heap space" - The minimum heap size is too small.  Increase the 
  2068.    size as required in APPENDIX A.
  2069.  
  2070.    "Too many windows" - Tried to create more windows than MaxWndw allows.  
  2071.    Either remove windows or increase MaxWndw.
  2072.  
  2073.    "Too many virtual windows" - Tried to create more virtual windows than 
  2074.    MaxVirtualWndw allows.  Either remove windows or increase MaxVirtualWndw.
  2075.  
  2076.    "Perm window out of order" - Tried to create a PermMode window while a 
  2077.    normal window is the top window.  Remove or hide window before making a 
  2078.    permanent window.  Routinely, all PermMode windows are created first.
  2079.  
  2080.    "No window to remove" - Tried to remove the initial window Window0 which is 
  2081.    permanent.
  2082.  
  2083.    "Hidden window not found" - Tried to write to a hidden window that does not 
  2084.    exist.  Check for the correct name.
  2085.  
  2086.    "Virtual screen not found" - Tried to write to a virtual screen that does 
  2087.    not exist.  Check for the correct name.
  2088.  
  2089.    "Video page not available" - Tried to write to a video page that has not 
  2090.    been allocated or does not exist for the hardware as expected.  Be sure to 
  2091.    use MaxValidPage.
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.    Appendix B: Error Messages                                          Page 35
  2116.